﻿using System;
using System.Text;
using System.Web;
using System.Web.UI.HtmlControls;
using AnyOffice.BIZ;
using AnyOffice.Components;
namespace AnyOffice.general.system.workflow.flow_type
{  
    public partial class type_delete : ModulePage
    {       
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                int num = (Request.QueryString["flow_id"] == null) ? 0 : int.Parse(Request.QueryString["flow_id"].ToString());
                int num2 = (Request.QueryString["sort_id"] == null) ? 0 : int.Parse(Request.QueryString["sort_id"].ToString());
                new WorkFlowBiz().DeleteForDesign(base.Conn, num);
                if (num2 != 0)
                {
                    StringBuilder builder = new StringBuilder("<script>\n");
                    builder.Append("parent.sort.location.reload();\n");
                    builder.Append("location = 'type_list.aspx?sort_id=" + num2.ToString() + "';\n");
                    builder.Append("</script>\n");
                    if (!this.Page.IsClientScriptBlockRegistered("flow_type"))
                    {
                        this.Page.RegisterClientScriptBlock("flow_type", builder.ToString());
                    }
                }
                else
                {
                    base.CloseConn();
                    Response.Redirect("index.aspx");
                }
            }
        }
       
    }
}

